package com.dongguo.shardingjdbc.controller;

import java.util.List;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dongguo.shardingjdbc.entity.Dict;
import com.dongguo.shardingjdbc.entity.TestDemo;
import com.dongguo.shardingjdbc.mapper.DictMapper;
import com.dongguo.shardingjdbc.service.TestDemoService;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;


/**
 * swagger 用户测试方法
 * @author 
 */

@Api(value = "/test/user", tags = "测试例子")
@RestController
@RequestMapping("/test/user")
@Slf4j
public class TestController {
	
	@Autowired
	private TestDemoService testDemoService;
	@Autowired
	private DictMapper dictMapper;
	
	@PostConstruct
	public void initData() {
		try {
			log.info("系统初始化数据******START******************"); 
			List<TestDemo>  dataList=testDemoService.list();
			//List<Dict>  dataList=dictMapper.selectList(null);
			log.info(""+dataList.size()); 
			log.info("系统初始化数据*******END****************"); 
		} catch (Exception e) {
			log.error(e.getMessage(), e);
		}
	}
   
}
